<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Tables - SB Admin</title>

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.css" rel="stylesheet">
	<style>
	.table-no-line > thead > tr > th, .table-no-line > tbody > tr > th, .table-no-line > tfoot > tr > th, .table-no-line > thead > tr > td, .table-no-line > tbody > tr > td, .table-no-line > tfoot > tr > td {
		border-top: none !important;
	}
	</style>

    <!-- Add custom CSS here -->
    <link href="css/sb-admin.css" rel="stylesheet">
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
  </head>

  <body>

    <div id="wrapper">

      <!-- Sidebar -->
      <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="index.html">SB Admin</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse navbar-ex1-collapse">
          <ul class="nav navbar-nav side-nav">
            <li><a href="home.html"><i class="fa fa-dashboard"></i> Dashboard</a></li>
			<!--
            <li><a href="charts.html"><i class="fa fa-bar-chart-o"></i> Charts</a></li>
			-->
            <li class="active"><a href="tables.html"><i class="fa fa-table"></i> Lihat Nilai</a></li>
			<!--
            <li><a href="forms.html"><i class="fa fa-edit"></i> Forms</a></li>
            <li><a href="typography.html"><i class="fa fa-font"></i> Typography</a></li>
            <li><a href="bootstrap-elements.html"><i class="fa fa-desktop"></i> Bootstrap Elements</a></li>
            <li><a href="bootstrap-grid.html"><i class="fa fa-wrench"></i> Bootstrap Grid</a></li>
            <li><a href="blank-page.html"><i class="fa fa-file"></i> Blank Page</a></li>
            <li class="dropdown">
              <a href="#edit" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-caret-square-o-down"></i> Dropdown <b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="#edit">Dropdown Item</a></li>
                <li><a href="#edit">Another Item</a></li>
                <li><a href="#edit">Third Item</a></li>
                <li><a href="#edit">Last Item</a></li>
              </ul>
            </li>
			-->
          </ul>

          <ul class="nav navbar-nav navbar-right navbar-user">
            <li class="dropdown messages-dropdown">
              <a href="#edit" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-envelope"></i> Messages <span class="badge">7</span> <b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li class="dropdown-header">7 New Messages</li>
                <li class="message-preview">
                  <a href="#edit">
                    <span class="avatar"><img src="http://placehold.it/50x50"></span>
                    <span class="name">Guru:</span>
                    <span class="message">Hey there, I wanted to ask you something...</span>
                    <span class="time"><i class="fa fa-clock-o"></i> 4:34 PM</span>
                  </a>
                </li>
                <li class="divider"></li>
                <li class="message-preview">
                  <a href="#edit">
                    <span class="avatar"><img src="http://placehold.it/50x50"></span>
                    <span class="name">Guru:</span>
                    <span class="message">Hey there, I wanted to ask you something...</span>
                    <span class="time"><i class="fa fa-clock-o"></i> 4:34 PM</span>
                  </a>
                </li>
                <li class="divider"></li>
                <li class="message-preview">
                  <a href="#edit">
                    <span class="avatar"><img src="http://placehold.it/50x50"></span>
                    <span class="name">Guru:</span>
                    <span class="message">Hey there, I wanted to ask you something...</span>
                    <span class="time"><i class="fa fa-clock-o"></i> 4:34 PM</span>
                  </a>
                </li>
                <li class="divider"></li>
                <li><a href="#edit">View Inbox <span class="badge">7</span></a></li>
              </ul>
            </li>
            <li class="dropdown alerts-dropdown">
              <a href="#edit" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-bell"></i> Alerts <span class="badge">3</span> <b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="#edit">Default <span class="label label-default">Default</span></a></li>
                <li><a href="#edit">Primary <span class="label label-primary">Primary</span></a></li>
                <li><a href="#edit">Success <span class="label label-success">Success</span></a></li>
                <li><a href="#edit">Info <span class="label label-info">Info</span></a></li>
                <li><a href="#edit">Warning <span class="label label-warning">Warning</span></a></li>
                <li><a href="#edit">Danger <span class="label label-danger">Danger</span></a></li>
                <li class="divider"></li>
                <li><a href="#edit">View All</a></li>
              </ul>
            </li>
            <li class="dropdown user-dropdown">
              <a href="#edit" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i> Guru <b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="#edit"><i class="fa fa-user"></i> Profile</a></li>
                <li><a href="#edit"><i class="fa fa-envelope"></i> Inbox <span class="badge">7</span></a></li>
                <li><a href="#edit"><i class="fa fa-gear"></i> Settings</a></li>
                <li class="divider"></li>
                <li><a href="#edit"><i class="fa fa-power-off"></i> Log Out</a></li>
              </ul>
            </li>
          </ul>
        </div><!-- /.navbar-collapse -->
      </nav>

      <div id="page-wrapper">

        <div class="row">
          <div class="col-lg-12">
            <h1>Tabel Nilai Siswa <small>Sort Your Data</small></h1>
            <ol class="breadcrumb">
              <li><a href="index.html"><i class="fa fa-dashboard"></i> Dashboard</a></li>
              <li class="active"><i class="fa fa-table"></i> Lihat Nilai</li>
            </ol>
            <div class="alert alert-info alert-dismissable">
              <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
              We're using <a class="alert-link" href="http://tablesorter.com/docs/">Tablesorter 2.0</a> for the sort function on the tables. Read the documentation for more customization options or feel free to use something else!
            </div>
          </div>
        </div><!-- /.row -->

        <div class="row">
          <div class="col-lg-6">
            <h3>Lihat Nilai Siswa</h3>
            <div class="table-responsive">
              <table class="table table-no-line table-hover tablesorter">
                <tbody>
                  <tr>
				    <td>Mata Pelajaran</td>
                    <td><select class="form-control">
					  <option>Matematika</option>
					  <option>Bahasa Jawa</option>
					  <option>Bahasa Linggis</option>
					</select></td>
                  </tr>
                  <tr>
                    <td>Kelas</td>
                    <td><select class="form-control">
					  <option>X</option>
					  <option>XI</option>
					  <option>XII</option>
					</select></td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
          <div class="col-lg-6">
            <h3>Bordered with Striped Rows</h3>
            <div class="table-responsive">
              <table class="table table-bordered table-hover table-striped tablesorter">
                <thead>
                  <tr>
                    <th>No <i class="fa fa-sort"></i></th>
                    <th>NIS <i class="fa fa-sort"></i></th>
                    <th>Nama Siswa <i class="fa fa-sort"></i></th>
                    <th>Nilai <i class="fa fa-sort"></i></th>
                    <th>Action</i></th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td>1</td>
                    <td>1265</td>
                    <td>Inu</td>
                    <td>$321.33</td>
                    <td><a href="#edit">Edit</a> | <a href="#detail">Detail</a></td>
                  </tr>
                  <tr>
                    <td>2</td>
                    <td>261</td>
                    <td>Ina</td>
                    <td>$234.12</td>
                    <td><a href="#edit">Edit</a> | <a href="#detail">Detail</a></td>
                  </tr>
                  <tr>
                    <td>3</td>
                    <td>665</td>
                    <td>Inan</td>
                    <td>$16.34</td>
                    <td><a href="#edit">Edit</a> | <a href="#detail">Detail</a></td>
                  </tr>
                  <tr>
                    <td>4</td>
                    <td>9516</td>
                    <td>Njajal</td>
                    <td>$1644.43</td>
                    <td><a href="#edit">Edit</a> | <a href="#detail">Detail</a></td>
                  </tr>
                  <tr>
                    <td>5</td>
                    <td>1234</td>
                    <td>Oke sip</td>
                    <td>35</td>
                    <td><a href="#edit">Edit</a> | <a href="#detail">Detail</a></td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
        </div><!-- /.row -->

        <div class="row">
          <div class="col-lg-6">
			<input type="text" value="90">
            <button type="submit" class="btn btn-default">Update Nilai</button>
          </div>
        </div><!-- /.row -->

      </div><!-- /#page-wrapper -->

    </div><!-- /#wrapper -->

    <!-- JavaScript -->
    <script src="js/jquery-1.10.2.js"></script>
    <script src="js/bootstrap.js"></script>
	<script>
		function Save(){
		var par = $(this).parent().parent(); //tr
		var tdName = par.children("td:nth-child(2)");
		var tdPhone = par.children("td:nth-child(3)");
		var tdEmail = par.children("td:nth-child(4)");
		var tdButtons = par.children("td:nth-child(5)");
	 
		tdName.html(tdName.children("input[type=text]").val());
		tdPhone.html(tdPhone.children("input[type=text]").val());
		tdEmail.html(tdEmail.children("input[type=text]").val());
		tdButtons.html("<a href='#edit'>Edit</a> | <a href='#detail'>Detail</a>");
	 
		$('a[href="#edit"]').bind("click", Edit);
		$('a[href="#detail"]').bind("click", ShowDetails);
	};
	function Edit(){
		var par = $(this).parent().parent(); //tr
		var tdName = par.children("td:nth-child(2)");
		var tdPhone = par.children("td:nth-child(3)");
		var tdEmail = par.children("td:nth-child(4)");
		var tdButtons = par.children("td:nth-child(5)");
	 
		tdName.html("<input type='text' id='txtName' value='"+tdName.html()+"'/>");
		tdPhone.html("<input type='text' id='txtPhone' value='"+tdPhone.html()+"'/>");
		tdEmail.html("<input type='text' id='txtEmail' value='"+tdEmail.html()+"'/>");
		tdButtons.html("<a href='#save'>Save</a>");
	 
		$('a[href="#save"]').bind("click", Save);
	};
	
	function UpdateNilai(){
		alert("Not yet implemented");
	}
	
	function ShowDetails(){
		alert("Not yet implemented");
	}
	
	$(function(){
		//Add, Save, Edit and Delete functions code
		$('a[href="#edit"]').bind("click", Edit);
		$('a[href="#detail"]').bind("click", ShowDetails);
		$('button[type="submit"]').bind("click", UpdateNilai);
	});
	$('a[href="#edit"]').click(function(e){
	  e.preventDefault();
	});
	</script>

    <!-- Page Specific Plugins -->
    <script src="js/tablesorter/jquery.tablesorter.js"></script>
    <script src="js/tablesorter/tables.js"></script>

  </body>
</html>